import 'package:flutter/material.dart';

// 弹性布局

// 使用Expanded组件可以解决文字超出区域溢出问题
class ExpandedWidget extends StatelessWidget {
  const ExpandedWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.blue,
        title: Text("Expanded组件使用示例"),
      ),
      body: Center(
        child: Container(
          height: 100,
          color: Colors.grey,
          child: Row(
            children: [
              Expanded(
                flex: 1,
                child: Container(height: 86, color: Colors.red),
              ),

              Expanded(
                flex: 2,
                child: Container(height: 86, color: Colors.yellow),
              ),
              Expanded(
                flex: 1,
                child: Container(height: 86, color: Colors.blue),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
